<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .prize {
            font-size: 24px;
            margin: 20px;
            text-align: center;
        }
        button {
            padding: 10px 20px;
            font-size: 18px;
            cursor: pointer;
            padding-right: 20px;
        }
    </style>
</head>
<body>
    <div class="prize">一等奖:<span id="first"></span></div>
    <div class="prize">二等奖:<span id="second"></span></div>
    <div class="prize">三等奖:<span id="third"></span></div>
    <button onclick="star()">开始抽奖</button>
    <script>
        const personAll = ['李佳敏','易业煜','吴双烨','陈佳豪','邵进杰'];
        function star() {
            const firstIndex = Math.floor(Math.random() * personAll.length);
            document.getElementById('first').innerText = personAll[firstIndex];
            let secondIndex;
            do {
                secondIndex = Math.floor(Math.random() * personAll.length);
            } while (secondIndex === firstIndex);
            document.getElementById('second').innerText = personAll[secondIndex];
            let thirdIndex;
            do {
                thirdIndex = Math.floor(Math.random() * personAll.length);
            } while (thirdIndex === firstIndex || thirdIndex === secondIndex);
            document.getElementById('third').innerText = personAll[thirdIndex];
        }

    </script>
</body>
</html>
